import 'package:flutter/material.dart';

class NoScrollGlowOverscrollIndicator extends ScrollBehavior {
  @override
  ScrollPhysics getScrollPhysics(BuildContext context) {
    return BouncingScrollPhysics(); // 使用特定的滚动物理效果
  }
  @override
  Widget buildViewportChrome(
      BuildContext context,
      Widget child,
      AxisDirection axisDirection,
      ) {
    return child;
  }
}

class CustomScrollBehavior extends ScrollBehavior {
  Color defaultColor = Color(0xFFFFFFFF);
  CustomScrollBehavior (this.defaultColor);
  @override
  Widget AndroidOverscrollIndicator(
      BuildContext context,
      Widget child,
      AxisDirection axisDirection,
      ) {
    return GlowingOverscrollIndicator(
      child: child,
      axisDirection: axisDirection,
      color: defaultColor, // 设置你想要的颜色
    );
  }



  // @override
  // Widget buildScrollbar(
  //     BuildContext context,
  //     Widget child,
  //     ScrollableDetails details,
  //     ) {
  //   return child;
  // }
  //
  // @override
  // TargetPlatform getPlatform(BuildContext context) {
  //   return Theme.of(context).platform; // 获取平台信息
  // }

  @override
  Color get dragColor => Colors.red.withOpacity(0.3); // 设置滚动拖动的颜色
}
